package com.crm.service.impl.contractManager.statistics;

import com.crm.dao.mapper.customMapper.customerContractCustomMapper.statistics.CustomerContractStatisticsMapper;
import com.crm.model.vo.customerContractManager.ContractStatisticsVO;
import com.crm.service.contractManager.statistics.CustomerContractStatisticsDbService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author yincuimei
 * @Date 2021/4/22 8:47
 */
@Service
public class CustomerContractStatisticsDbServiceImpl implements CustomerContractStatisticsDbService {
    @Autowired
    private CustomerContractStatisticsMapper customerContractStatisticsMapper;

    /**
     * 会员分析->新增会员数、成交顾客数按本年度、上年度统计
     * @param companyId    ---所在公司ID
     * @param dateUnit     ---日期类型(1:本年度;2:上年度)
     * @param contractType ---统计新增会员数时参数有值
     * @author yincuimei
     * @return
     */
    @Override
    public List<ContractStatisticsVO> selectNewMembersAndDealCountByYear(String companyId, Integer dateUnit,String contractType) {
        return customerContractStatisticsMapper.selectNewMembersOrDealCountByYear(companyId,dateUnit,contractType);
    }
}
